package com.tdh.tlgusers.controller;

import com.tdh.tlgusers.pojo.Collect;
import com.tdh.tlgusers.service.CollectService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RestController;

import java.text.SimpleDateFormat;
import java.util.List;

@RestController
public class CollectController {
    @Autowired
    private CollectService collectService;

    @GetMapping("/selCollect")
    public List<Collect> selCollect(Integer userId){
        return collectService.selCollects(userId);
    }

    @PostMapping("/addCollect")
    public int addCollect(Collect collect){
        return collectService.addCollect(collect);
    }

    @PostMapping("/delCollect")
    public int delCollect(Integer collectId){
        return collectService.delCollect(collectId);
    }
}
